import random

a_x, a_y = -7, 8
b_x, b_y = 5, -8
c_x, c_y = 5, 5
d_x, d_y = -7, 5

n = int(input("Введите количество выстрелов: "))
hits = 0

for _ in range(n):
    x = random.randint(-100, 100)
    y = random.randint(-100, 100)

    if (x == a_x and y >= a_y and y <= c_y) or (x == c_x and y >= b_y and y <= c_y) or (y == a_y and x >= a_x and x <= c_x) or (y == c_y and x >= d_x and x <= b_x):
        hits += 1

print("количество выстрелов", n)
print("количество попаданий:", hits)
